Contents
MultiText VBX v1.30	(Unregistered)

MultiText VBX (mtext.vbx) is a non-editable text box capable of displaying up to 32K of text using different fonts, font styles, and colors. Hypertext words may be embedded, and will cause an event to occur if clicked upon, as well as altering the cursor to a hand whilst over them. Portions of text may be selected with the cursor and copied to the clipboard, either as straight text or with formatting codes included. Text may be entered either by setting a property, or by directly loading text from within files. If loading text from a file, the text may be in either rich text format (RTF) or MultiText format (MTF).

New for version 1.30 are table displays (with auto column sizing), tabs, global indents, up to 16 user defined fonts, hypertext tags, SelStart & SelLength properties, and auto-displaying scroll bar.

MultiText 1.30 is VB1.0 compatible, and has been tested on Borland's Delphi.

Contents

Text formatting

Hypertext

Properties

Methods

Events

Tables

Rich-Text Format

Distribution

Release Notes

Registration

Quick Reference Chart

Legal Notice

(c) 1995 Steve Bannister


Text formatting

All of the features which alter how the text is displayed inside MultiText are set by embedding escape codes. This escape code is by default the open square bracket, but this may be altered by changing the SpecialChar property. After the escape code is a single character which instructs MultiText how to display the text which follows. To actually display the escape character, use one after the other, i.e. [[.

For instance to change the text to bold at a certain position would just require inserting [B . All text that follows will now be bold until [b is next encountered, where the bold text is turned off.

For a list of the escape codes, select on the category list that follows:

Fonts

Font styles

Colors

Special


Formatting:Fonts
Text formatting : Fonts

The letters on the left below should be placed after the escape character (default open square bracket) to change the font to that stated to the right. Using the DefArial, DefCourier etc font redefinition properties it is possible to change the font used when using the corresponding code below. For instance, if the DefModern property were set to 'MyFont', then anytime a [M occurs in the text the font used when displaying the text would be MyFont and not Modern. By redefining the 15 given fonts, and using the user defined font, it is possible to have up to 16 user defined fonts in a single piece of text.

A	Arial

C	Courier

N	Courier New

F	Fixedsys

M	Modern

E	MS Sans Serif

e	MS Serif

R	Roman

P	Script

L	Small Fonts

Y	Symbol

Z	System

T	Terminal

t	Times New Roman

W	Wingdings

a	UserFont (defined in UserFont property)


Formatting:Font Styles
Text formatting : Font styles

The letters on the left below should be placed after the escape character (default open square bracket) to change the font style to that stated to the right.

B	Bold on.

b	Bold off.

I	Italic on.

i	Italic off.

S	Strikethru on.

s	Strikethru off.

U	Underlining on.

u	Underlining off.


Text formatting : Colors

The letters on the left below should be placed after the escape character (default open square bracket) to change the color to that stated to the right. System default colors may be used.

0	ForeColor0 property, default &H000000& (black).

1	ForeColor1 property, default &H0000FF& (red).

2	ForeColor2 property, default &HFF0000& (dark blue).

3	ForeColor3 property, default &H00FF00& (light green).

4	ForeColor4 property, default &HFF00FF& (purple).

5	ForeColor5 property, default &HFFFF00& (light blue).

6.	ForeColor6 property, default &H00FFFF& (yellow).

7	ForeColor7 property, default &H808080& (grey).

8	ForeColor8 property, default &H008000& (dark green).

9	ForeColor9 property, default &HFFFFFF& (white).


Text formatting : Special

Superscript text can be started by following the escape character with a D. To turn this off use the d character.

Subscript text can be started by following the escape character with a G. To turn this off use the d character.

Fractions can be displayed in proper form, by use of the f character after the escape code. For instance to display 1/3 the notation would be

[f1/3

Note: Within the content of the fraction, other escape characters will cause unpredictable results and should not be used.

To turn the font, font style, and font color back to normal, use the q character after the escape code.

To separate cells within tables, use h after the escape code. To separate tables, use H after the escape.


Hypertext

Within the text displayed, words may be tagged as hotspots. As the cursor is moved over these, the appearance of the cursor will change to a hand. By clicking with the left mouse button whilst over a hotspot, a hot event will be caused, which passes back the index number of the word and the actual word itself.

To mark a word as a hotspot, insert an escape code (default open square bracket) followed by a g. The word that follows is now a hotspot.

The end of the word is either a space, or another escape character. The hotspot word will look no different from the rest of the text, but by inserting escape codes before and after the word it is possible to change the color, style, or actual font of the hotspot word.

To attach a tag to a hotspot word, use the escape code followed by a c followed by the tag word. This tag sequence may be placed anywhere after the hotword, but before the next one, and is not visible when displaying the text. For backwards compatibility, the tag word is not returned as a parameter in the hot event, but is placed in the run-time read-only property HotTag. The property always contains the tag word of the last hotword clicked. It is also global amongst any MultiText windows that maybe in use, and so should be read and copied to a variable early in the Hot event.

Note: The maximum number of hotspots that can be embedded in the text is 100, and any more than this will be ignored. It is recommended that the HilightEnabled property be set to false when using hotspots, as a faster event will occur when clicked upon. The maximum length of a hotword or hot tag word is 150 characters, but may not include spaces.


Properties

Standard properties are BackColor, Borderstyle, DragIcon, DragMode, Enabled, FontName, FontSize, Height, Index, Left, Mousepointer, Name, Scrollbar, TabIndex, Tag, Top, Visible, Width.

Note: FontSize is the height of the character cell in pixels and not point sizes, thus the values will need to be higher than their corresponding point size. If the mousepointer property is set to anything other that 0-Default then the cursor will not change to a hand when over a hotspot.

Custom properties are:

AutoPaint	DefTimesNewRoman	IndentLeft

AutoScroll	DefWingDings	IndentRight

BoxLines	ForeColor0	Lines

DefAerial	ForeColor1	LoadLength

DefCourier	ForeColor2	LoadStart

DefCourierNew	ForeColor3	NumHots

DefFixedSys	ForeColor4	ScrollMax

DefModern	ForeColor5	ScrollPos

DefMSSansSerif	ForeColor6	SelStart

DefMSSerif	ForeColor7	SelLength

DefRoman	ForeColor8	SpecialChar

DefScript	ForeColor9	TableGap

DefSmallFonts	Highlight	TabWidth

DefSymbol	HilightEnabled	Text

DefSystem	HiTextColor	UserFont

DefTerminal	HotTag


AutoPaint

This property can be set to either true (default) or false. If set to false the text box will not be refreshed when new text is loaded, nor if another window is placed over it and then moved off. To force a repaint, set the ForcePaint method to true.


AutoScroll

This property can be set to True or False. If False then the scroll bar is displayed according to the value of the Scrollbar property. If set to True the Scrollbar property is ignored, and a scroll bar will appear only if there are more lines of text than can be displayed within the space of the window.


BoxLines

This read-only, run-time property contains the maximum number of lines of text that will be seen in the MultiText window using the current fontsize.


DefFontname
DefAerial - DefWingDings

These properties contain the names of fonts to be used instead of the font specified by the property name (eg Arial in DefArial). Where the property is left blank the default will be used.


ForeColorn
ForeColor0 - ForeColor9

These correspond to the escape codes 0 to 9, as detailed in the text formatting topic.


Highlight

This color property represents the background color of the selected region of text. The default is the system setting.


HilightEnabled

This Boolean flag either enables or disables the selecting of text with the mouse. It is recommended that this is set to false if the feature is not required.


HiTextColor

This color property represents that color of text that is within a selected region. The default is the system setting


HotTag

This run-time, read-only property contains the tag associated with the last hot word clicked upon. It should however only be used directly after a hot event, otherwise it can not be guaranteed to hold the correct value.


IndentLeft

This property is the number of pixels between the left border of the window and the start of the text.


IndentRight

This property is the minimum number of pixels between the right border and text.


Lines

This run-time, read-only property contains the number of lines of text.


LoadLength property
LoadLength

This numeric long value contains the number of characters to be read in from file during a LoadFile or LoadRtf method. If set to 0 then the file will be read in to the end, up to a maximum of 32760 characters for loading with LoadFile and 65500 characters for ImportRtf.


LoadStart property
LoadStart

This numeric long value contains the start position within a file to be read in using the LoadFile method. If set to 0 then loading will resume from the beginning of the file.


NumHots property
NumHots

This run-time, read-only property contains the number of hotspots in the text.


ScrollMax property
ScrollMax

This run-time, read-only property contains the maximum value for the scroll position, regardless of whether a scroll bar is actually visible.


ScrollPos property
ScrollPos

This run-time value contains the current scroll position. Changing it will cause the scrollbar to change to the new position.


SelStart property
SelStart

This run-time, read-only property contains the start character position of highlighted text (including the escape code sequences and hidden tag words.


SelLength property
SelLength

This run-time, read-only property contains the number of characters of highlighted text (including the escape code sequences and hidden tag words.


SpecialChar property
SpecialChar

This property contains the ANSI character code for the escape character. By default this is 91 which represents the open square bracket.


TableGap property
TableGap

This property contains the number of extra pixels added to the width of auto-sized columns within a table. .


TabWidth property
TabWidth

This property contains the number of pixels between tab stop positions.


Text property
Text

This contains the actual text, with embedded format codes, that will be shown in the MultiText window. The maximum number of lines of text that may be stored is 700.


UserFont property
UserFont

This property can contain an extra font name of your choice. To use the font within the text, either select UserFont from the FontName property, or insert escape character a in the body of the text to change the font. The maximum length of a font is 19 characters.


Methods

Below are the methods applicable to MultiText at run time.

Copy

By setting to TRUE, the selected region of text will be copied into the clipboard.

CopyFormat

By setting to TRUE, the selected region of text, along with any formatting codes within that region, are copied to the clipboard. The length of this text is held in the SelLength property.

ForcePaint

By setting this to true, a repaint of the mtext box will occur. It will also reset the AutoPaint property back to True. This will usually be used in conjunction with the AutoPaint property.

ImportRTF

By setting this to the full file name of an RTF file, the file will be loaded and converted into MultiText format (MTF). LoadStart and LoadLength properties are also used to determine where in the file the data is loaded from. Click here for a more detailed explanation.

LoadFile

By setting this to the full name of a file, the text property will be replaced by the contents of the file. Characters are read in from position LoadStart, and LoadLength characters are read in. If LoadLength is set to 0 then all characters up the end of the file are loaded, up to a maximum of 32760. The maximum number of lines of text that MultiText can store is 700.

ScrollDown

By setting to TRUE the text will scroll down one line. This will occur even if the scrollbar property is set to false.

ScrollUp

By setting to TRUE the text will scroll up one line. Thus will occur even if the scrollbar property is set to false.


Events

The standard events are Click, DblClick, DragDrop, DragOver, MouseDown, MouseMove, and MouseUp.

One custom event exists :

Hot

This event is fired when the user clicks upon a hotspot. Two parameters are passed back. HotIndex is an integer and contains the hotspot number. The first hotspot word in the text is 0, the next is 1 etc. HotWord contains the actual word pressed (or the first 150 characters of it). To view any tag word associated with a hotspot, view it by looking at the HotTag property.


Distribution

If MultiText is to be distributed as part of an application then the file MTEXTRT.VBX must be used, but it must be renamed to MTEXT.VBX on the distribution disk.

Under no circumstances may the design time version be distributed within an application.

Only registered users of MultiText may distribute the run time version with their applications, or use it commercially. The run time version is only available to registered users.


Registration

To be able to distribute MultiText with your applications, or to use it commercially, or if you just want to continue to use MultiText with a clean conscience, you must first register. Remember, this is just an evaluation copy only. Once registered you will receive the run time version which may be distributed by you in your applications, with no restrictions on the volume sold. The registered version will not place any extra text to the bottom of imported RTF files, nor will it display a message box when used with a .EXE VB program.

The cost of registering for MultiText is 15 Great Britain pounds or 25 United States dollars, made payable to Steve Bannister. Please state if you would prefer to receive your copy on disk or sent by e-mail. If you decide on e-mail, you will get a faster reply and will qualify for free upgrades as they are made, including the 32 bit OCX version when available. If you do not reside in either the UK or US you may pay using your local currency.

Please do not send cheques or postal orders made out in a currency not local to the bank branch printed on the check.

I can also upload the files using FTP if you have a site running an FTP daemon, although I will not upload to an anonymous FTP site.

Please send your cheques or international money orders, and details on which method you would like to receive the files, to :

Steve Bannister

41 Milton Street

Northampton

NN2 7JG

ENGLAND

If you have any queries/comments/bug-reports you can also e-mail me at

s.bannister@pobox.com

Source code is available for purchase at 100 GBP, or equivalent local currency. Contact me for details.


Release Notes
Release Notes & Known bugs

1.30

New IndentLeft and IndentRight properties.

Tabs now supported, using new TabWidth property.

Fonts may be redefined allowing up to 16 user defined fonts.

Hotspot words can have tags associated with them, accessible using the new HotTag property.

New AutoScroll property: Displays a vertical scrollbar only when necessary.

New SelStart and SelLength properties for locating highlighted text.

Bug Fix : Scrollbar is now default Windows color (gray), not white.

Bug Fix : Background color no longer flashes when changing the text property.

Bug Fix : Cursor no longer changes to hand when at bottom of window for no reason.

Bug Fix : Text no longer scrolls when bottom of window is clicked.

Bug Fix : Scrolling now works perfectly even when window is partly obscured.

Bug Fix : Hotspots at beginning of lines were not always recognised.

Bug Fix : Font sizes over 36 pixels didn't work.

1.20

New RTF Converter. Files in rich-text format can be directly loaded from disk into MultiText where they are convered into MultiText format (MTF).

New UserFont property. One font of the users choosing may be used.

New AutoPaint property: Ability to suspend normal re-paints of the mtext window.

New ForcePaint method: Ability to force a re-paint of the mtext window.

Bug Fix: CopyFormat method not always copying all data selected.

Bug Fix: Escape code [q not restoring color.

1.19

Bug Fix: Mousepointer was not being restored from a hand back to an arrow after new text loaded from result of clicking a hyperlink.

1.18

First general release

Known Bugs (1st Oct 1995)

Italics in some fonts get chopped at the right ends.


Quick Reference
MultiText Quick Reference Escape Character Chart

Fonts	Font Styles

A	Arial	B	Bold on

C	Courier	b	Bold off

N	Courier New	I	Italic on

F	Fixedsys	i	Italic off

E	MS Sans Serif	S	Superscript on

e	MS Serif	s	Superscript off

M	Modern	U	Underline on

R	Roman	u	Underline off

P	Script

L	Small Fonts	Special

Y	Symbol	D	Superscript on

Z	System	d	Superscript off

T	Terminal	f	Fraction

t	Times New Roman	G	Subscript on

W	Wingdings	g	Hypertext

a	UserFont	q	Restore to defaults

c	Hot spot tag word

h	Table cell separator

H	Table separator

Color

0	ForeColor0 (default black)	5	ForeColor5 (default light blue)

1	ForeColor1 (default red)	6	ForeColor6 (default yellow

2	ForeColor2 (default dark blue)	7	ForeColor7 (default grey)

3	ForeColor3 (default light green)	8	ForeColor8 (default dark green)

4	ForeColor4 (default purple)	9	ForeColor9 (default white)


Rich-Text Foramt
Rich-Text Format

RTF files may be loaded into MultiText using the ImportRtf method at run-time only. The entire RTF file must be loaded, if LoadLength or LoadStart are used to 'chop' part of the file it will cause a run-time error. You may concatenate RTF files together and use LoadStart and LoadLength to extract the file part required.

Only the features supported by MultiText will be used from the RTF file. Any other features will not be seen and should still work successfully. If possible it is advisible to keep with MultiText's capabilities.

To incorporate hyperlinks you need to double underline the words, and if you require them in a different color you should do this also. Some RTF writers may define more colors than MultiText can store (which is 10), even if you are not using all these colors. If you choose a color for a hotspot and it does not show then the color has been given a definition number greater than can be used. The way round this is to use a different color that will be shown, then optionally change the corresponding ForeColor property to the color you actually want it to appear as. If this operation is done one after the other then no flicker will occur. In future versions I will get round this by having a hotspot color so there will be no need to color your own hotspots.

Once an RTF file has been loaded the ForeColor properties will change to reflect the color table specified within the RTF file.

RTF files may contain the font specified in the UserFont property.

When loading an RTF file, the maximum length of the file is 65,500 bytes, although the length of the decoded text used within MultiText must not exceed 32,760 bytes. The encoding method used in RTF often increases the length of a straight text file by a considerable amount.

Although MultiText may handle up to 10 tables, correctly sizing the column width for each, with tables loaded in from RTF files, only one table will be recognised. More tables may be used but the column sizing for all tables will be the same, based on the width of the longest cell from any table.

The shareware version will add a message to the bottom of the imported text stating the version is unregistered.


Steve Bannister

MultiText VBX was written by

Steve Bannister

41 Milton Street

Northampton

NN2 7JG

ENGLAND

s.bannister@pobox.com

If you need a DLL or custom control written, either 16 or 32 bit, then contact me for details.

The source code for this VBX is available for 100 GBP, or equivalent local currency, contact me for details.


Tables

A table allows columns of data to be arranged such that the width of each column is based on the longest cell entry within each column, plus the number of pixels held in the TableGap property. To separate the data held in each column, place the escape character followed by a h. To separate tables, use the escape character followed by a H. This should be placed anywhere between 2 tables, but not before the first one. Placing one there will reduce the number of tables allowed from 10 down to 9.

The maximum number of columns within a table is 20.

The maximum number of tables within the text is 10.

No lines are drawn around the table.


Other currencies price list :

Australia	30 Dollars	Ireland	15 Punts

Austria	230 Schillings 	Italy	38000 Lire

Belgium	680 Francs	Japan	2400 Yen

Canada	35 Dollars	Malta	10 Pounds

Cyprus	10 Pounds	New Zealand	35 Dollars

Denmark	130 Kroner	Norway	150 Kroner

Finland	100 Marks	Portugal	3500 Escudos

France	120 Francs	S. Africa	80 Rand

Germany	35 Marks	Spain	2800 Pesetas

Greece	5340 Drachmae	Sweden	170 Kroner

Holland	40 Guilders	Switzerland	30 Francs

Hong Kong	180 Dollars

Note : I reserve the right to amend these prices at any time if exchange rates vary by a large amount. The base price is always 15 GBP, from which overseas prices are derived using current exchange rates.


Legal Notice

MULTITEXT VBX VERSION 1.30 (C) 1995 STEVE BANNISTER

THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  THE

AUTHOR DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING

THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DAMAGES WHATSOEVER

INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS

PROFITS OR SPECIAL DAMAGES, EVEN IF THE AUTHOR HAS BEEN ADVISED OF

THE POSSIBILITY OF SUCH DAMAGES.